package com.CampaignManager.server;

import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class UnitType {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	@Persistent
	private String name;
	@Persistent
	private Long fieldAllowance;
	@Persistent
	private Long minPoints;
	@Persistent
	private Long maxPoints;
	@Persistent
	private String href;
	@Persistent
	private String attached;
	@Persistent
	private String faction;
	@Persistent
	private String modelType;
	
	@Persistent(mappedBy = "unitType")
	private List<UnitTypeResource> resources;
	public List<UnitTypeResource> getResources() {		
		if (resources == null) resources = new ArrayList<UnitTypeResource>();
		return resources;
	}
	
	public String getModelType() {
		return modelType;
	}
	public void setModelType(String modelType) {
		this.modelType = modelType;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Long getFieldAllowance() {
		return fieldAllowance;
	}
	public void setFieldAllowance(Long fieldAllowance) {
		this.fieldAllowance = fieldAllowance;
	}
	public Long getMinPoints() {
		return minPoints;
	}
	public void setMinPoints(Long minPoints) {
		this.minPoints = minPoints;
	}
	public Long getMaxPoints() {
		return maxPoints;
	}
	public void setMaxPoints(Long maxPoints) {
		this.maxPoints = maxPoints;
	}
	public String getHref() {
		return href;
	}
	public void setHref(String href) {
		this.href = href;
	}
	public String getAttached() {
		return attached;
	}
	public void setAttached(String attached) {
		this.attached = attached;
	}
	public String getFaction() {
		return faction;
	}
	public void setFaction(String faction) {
		this.faction = faction;
	}
	public Long getId() {
		return id;
	}
}
